<?php defined('IN_YUNYECMS') or exit('No permission.'); ?><nav class="main-header navbar navbar-expand navbar-white navbar-light">
  <ul class="nav navbar-nav">
    <li class="nav-item">
      <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
    </li>
    <li class="nav-item d-none d-sm-inline-block">
      <a href="<?php echo ROOT;?>" class="nav-link">
        <i class="fa fa-home" aria-hidden="true"></i> 首页
      </a>
    </li>
    <?php $tag_parse = core::load_class('tag_parse');$data=$tag_parse->cat_tag(array('level'=>'1'));?>
    <?php if(is_array($data)): $i = -1; $__DATA__ = $data;if(count($__DATA__)==0 )  echo "" ;foreach($__DATA__ as $key=>$v): $mod = ($i % 2 );++$i;?>
    <li class="nav-item d-none d-sm-inline-block">
      <a href="<?php echo $v["url"] ;?>" class="nav-link">
        <?php echo $v["title"] ;?>
      </a>
    </li>
    <?php  endforeach;  endif; ?>
    
  </ul>
  <!-- Navbar Right Menu -->
  <ul class="navbar-nav ml-auto">
    <!-- User Account: style can be found in dropdown.less -->
    <li class="nav-item dropdown user user-menu tipright">

      <a href="#" class="dropdown-toggle" data-toggle="dropdown">
        <img src="/public/ui/dist/img/user.png" class="user-image" alt="User Image">
        <span class="hidden-xs"><?php echo $member["username"] ;?></span>
      </a>
      <ul class="dropdown-menu">
        <!-- User image -->
        <li class="user-header">
          <img src="/public/ui/dist/img/user.png" class="img-circle" alt="User Image">
          <p class="text-white">
            <?php echo GetMemberGroupName($member["groupid"]);?> <small>上次登录： <?php if($member['lastlogintime']){echo
                date('Y-m-d H:i:s',$member['lastlogintime']);}else{
                echo date('Y-m-d H:i:s',$member['addtime']);
                }?></small>
          </p>
        </li>
        <!-- Menu Footer-->
        <li class="user-footer">
          <div class="float-left">
            <a href="<?php echo url('member/member/myinfo');?>" class="btn btn-info btn-flat" target="maincontent"><i
                class="fa fa-user"></i> 个人资料</a>
          </div>
          <div class="float-right">
            <a href="<?php echo url('member/member/logout');?>" class="btn btn-danger btn-flat"><i
                class="fa fa-close"></i> 退 出</a>
          </div>
        </li>
      </ul>
    </li>
    <li class="nav-item">
      <a class="nav-link" data-widget="fullscreen" href="#" role="button">
        <i class="fas fa-expand-arrows-alt"></i>
      </a>
    </li>
  </ul>
</nav>

<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar sidebar-dark-primary">
  <!-- Logo -->
  <a href="<?php echo ROOT;?>" class="brand-link" target="_blank">
    <img src="<?php echo YUNYECMS_UI; ?>dist/img/logo-member.png" alt="<?php echo $lang["sitename"] ;?>"
      class="brand-image img-circle elevation-3" style="opacity: .8">
    <span class="brand-text font-weight-light"><?php echo $lang["sitename"] ;?></span>
  </a>
  <!-- sidebar: style can be found in sidebar.less -->
  <div class="sidebar">
    <!-- Sidebar user panel -->
    <div class="user-panel mt-3 pb-3 mb-3 d-flex">
      <div class="info">
        <a href="<?php echo url('member/member/myinfo');?>" class="d-block"><i class="fa fa-circle text-yellow"></i>
          <?php echo $member["username"] ;?> &nbsp;&nbsp;<?php echo GetMemberGroupName($this->member["groupid"]);?></a>
      </div>
    </div>
    <!-- sidebar menu: : style can be found in sidebar.less -->
    <?php 
      $cssmember="";
      $cssorder="";
      if((ROUTE_C=='membergroup_orders'||ROUTE_C=='grant_orders'||ROUTE_C=='ucontent'||ROUTE_A=='mygrant'||ROUTE_A=='addons'||ROUTE_C=='orders')||(ROUTE_C=='member'&&
      ROUTE_A=='index')){
      $cssorder="menu-open active";
      }else{
      $cssmember="menu-open active";
      }
    ?>
    <nav class="mt-2">
      <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
        <li class="nav-item  <?php echo $cssorder;?>">
          <a href="#" class="nav-link">
            <i class="fa fa-files-o"></i>
            <p>
              基础信息管理
              <i class="right fas fa-angle-left"></i>
            </p>
          </a>
          <ul class="nav nav-treeview  menu-open ">
            <li <?php if(ROUTE_C=='orders' &&ROUTE_A=='index' ) { ?> class="nav-item  active" <?php } ?>> <a class="nav-link"
                href="<?php echo url('shop/orders/index');?>"> <i class="fa fa-list"></i>
                <p>订单管理</p>
              </a></li>
            <li <?php if(ROUTE_C=='ucontent' ) { ?> class="nav-item  menu-open active" <?php } else { ?> class="nav-item" <?php } ?>>
              <a href="#" class="nav-link"><i class="fa fa-circle"></i>
                <p>
                  内容管理
                  <i class="right fas fa-angle-left"></i>
                </p>
              </a>
              <ul class="nav nav-treeview">
                <?php $tag_parse = core::load_class('tag_parse');$data=$tag_parse->cat_tag(array('level'=>'3','tougao'=>'1','pid'=>'0'));?>
                <?php if(is_array($data)): $i = -1; $__DATA__ = $data;if(count($__DATA__)==0 )  echo "" ;foreach($__DATA__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                <?php if($vo['child']){
                                              $onearrowcss=' <i class="right fas fa-angle-left"></i>';
                                              $onetitleurl="javascript:;";  
                                                  if($catid==$vo['id']||$parentid==$vo['id']||$scatid==$vo['id']||$rootcatid==$vo['id']){ 
                                                   $onecurcss=' class="nav-item active"';
                                                   $onesubcss='class="nav nav-treeview menu-open" style="display: block;"';
                                                   }else{ $onecurcss='class="nav-item"';  $onesubcss='class="nav nav-treeview" '; }
                                              }else{ $onearrowcss='';
                                               $modeltype=getmodeltype($vo["modelid"]);
                                               $onetitleurl=url('member/ucontent/'.$modeltype.'',array('catid'=>$vo['id']));
                                               if($catid==$vo['id']||$parentid==$vo['id']||$scatid==$vo['id']||$rootcatid==$vo['id']){ 
                                               $onecurcss=' class="nav-item active"';
                                               }else{ $onecurcss='class="nav-item"';}
                                           }
                                           ?>
                <li <?php echo $onecurcss;?>><a href="<?php echo $onetitleurl;?>" class="nav-link"><i class="far fa-circle nav-icon"></i>
                    <p> <?php echo $vo["title"] ;?> <?php echo $onearrowcss;?> </p>
                  </a>
                  <?php if($vo['child']): ?>
                  <ul <?php echo $onesubcss;?>>
                    <?php if(is_array($vo['child'])): $k2 = -1; $__DATA__ = $vo['child'];if(count($__DATA__)==0 )  echo "" ;foreach($__DATA__ as $key=>$vo_cat2): $mod = ($k2 % 2 );++$k2;?>
                    <?php if($vo_cat2['child']){
                                           $twotitleurl="javascript:;"; 
                                           if($catid==$vo_cat2['id']||$parentid==$vo_cat2['id']){ 
                                           $twocurcss=' class="nav-item active"';
                                           $twosubcss='class="nav nav-treeview menu-open" style="display: block;"';
                                           }else{ $twocurcss=' class="nav-item';  $twosubcss='class="nav nav-treeview" '; }
								      } else{
                                      $modeltype2=getmodeltype($vo_cat2["modelid"]);
									  $twotitleurl=url('member/ucontent/'. $modeltype2.'',array('catid'=>$vo_cat2['id']));
									  }
									  if($catid==$vo_cat2['id']){ 
									  $onecurcss=' class="nav-item active"';
									  $twocurcss=' class="nav-item active"';
									  }else{  $onecurcss='class="nav-item"';$twocurcss='class="nav-item"'; }
							?>
                    <li <?php echo $twocurcss;?>><a href="<?php echo $twotitleurl;?>" class="nav-link"><i class="far fa-circle nav-icon"></i>
                        <p> <?php echo $vo_cat2["title"] ;?>
                          <?php if($vo_cat2['child']): ?><i class="right fas fa-angle-left"></i>
                          <?php endif; ?>
                        </p>
                      </a>
                      <?php if($vo_cat2['child']): ?>
                      <ul <?php echo $twosubcss;?>>
                        <?php if(is_array($vo_cat2['child'])): $k3 = -1; $__DATA__ = $vo_cat2['child'];if(count($__DATA__)==0 )  echo "" ;foreach($__DATA__ as $key=>$vo_cat3): $mod = ($k3 % 2 );++$k3;?>
                        <?php 
                    $modeltype3=getmodeltype($vo_cat3["modelid"]);
									  $threetitleurl=url('member/ucontent/'. $modeltype3.'',array('catid'=>$vo_cat3['id']));
									  if($catid==$vo_cat3['id']){ 
									  $onecurcss=' class="nav-item active"';
									  $twocurcss=' class="nav-item active"';
									  $threecurcss=' class="nav-item active"';
									  }else{  $onecurcss='class="nav-item"';$twocurcss='class="nav-item "';$threecurcss='class="nav-item"'; }
							    ?>
                        <li <?php echo $threecurcss;?>><a href="<?php echo $threetitleurl;?>" class="nav-link"><i
                              class="far fa-dot-circle nav-icon"></i>
                            <p><?php echo $vo_cat3["title"] ;?></p>
                          </a></li>
                        <?php  endforeach;  endif; ?>
                      </ul>
                      <?php endif; ?>
                    </li>
                    <?php  endforeach;  endif; ?>
                  </ul>
                  <?php endif; ?>
                </li>
                <?php  endforeach;  endif; ?>
                
              </ul>
            </li>
          </ul>
        </li>

        <li class="nav-item <?php echo $cssorder;?>">
          <a href="#" class="nav-link">
            <i class="fa fa-files-o"></i>
            <p>
              我的订单
              <i class="right fas fa-angle-left"></i>
            </p>
          </a>
          <ul class="nav nav-treeview">
            <li <?php if(ROUTE_C=='membergroup_orders' ) { ?> class=" nav-item active" <?php } ?>> <a class="nav-link"
                href="<?php echo url('member/membergroup_orders/index');?>"> <i class="fa fa-circle"></i>
                <p>会员升级订单</p>
              </a>
            </li>
            <li <?php if(ROUTE_C=='orders' &&ROUTE_A=='index' ) { ?> class="nav-item active" <?php } ?>> <a class="nav-link"
                href="<?php echo url('shop/orders/index');?>"> <i class="fa fa-list"></i>
                <p>产品订单</p>
              </a></li>
          </ul>
        </li>
        <li class="<?php echo $cssmember;?> nav-item">
          <a href="#" class="nav-link">
            <i class="fa fa-user-o"></i>
            <p>
              会员中心
              <i class="right fas fa-angle-left"></i>
            </p>
          </a>
          <ul class="nav nav-treeview">
            <li <?php if(ROUTE_A=='index' &&ROUTE_C=='member' ) { ?> class="nav-item active" <?php } ?>><a class="nav-link"
                href="<?php echo url('member/member/index');?>"><i class="fa fa-home"></i>
                <p>会员首页</p>
              </a></li>
            <li <?php if(ROUTE_C=='membergroup_goods' ) { ?> class="nav-item active" <?php } ?>><a class="nav-link"
                href="<?php echo url('member/membergroup_goods/index');?>"> <i class="fa fa-user"></i>
                <p>会员升级</p>
              </a></li>
            <li <?php if(ROUTE_A=='myinfo' ) { ?> class="active" <?php } ?>><a href="<?php echo url('member/member/myinfo');?>"
                class="nav-link"> <i class="fa fa-user"></i>
                <p>我的资料</p>
              </a></li>

            <li <?php if(ROUTE_C=='cart' ) { ?> class="nav-item active" <?php } ?>> <a href="<?php echo url('shop/cart/index');?>"
                class="nav-link"> <i class="fa fa-shopping-cart"></i>
                <p>购物车</p>
              </a></li>



            <li <?php if(ROUTE_C=='notice' ) { ?> class="nav-item active" <?php } ?>> <a class="nav-link"
                href="<?php echo url('member/notice/index');?>"> <i class="fa fa-bullhorn"></i>
                <p>通知消息</p>
              </a></li>
            <?php $tag_parse = core::load_class('tag_parse');$data=$tag_parse->cat_tag(array('pid'=>'9'));?>
            <?php if(is_array($data)): $i = -1; $__DATA__ = $data;if(count($__DATA__)==0 )  echo "" ;foreach($__DATA__ as $key=>$v): $mod = ($i % 2 );++$i;?>
            <li <?php if(ROUTE_A=='customform' ) { ?> class="nav-item active" <?php } ?>><a class="nav-link"
                href="<?php echo url('member/member/customform',array('catid'=>$v['id']));?>"> <i
                  class="fa fa-commenting-o"></i>
                <p>我的<?php echo $v["title"] ;?></p>
              </a>
            </li>
            <?php  endforeach;  endif; ?>
            
            <li <?php if(ROUTE_A=='pwd' ) { ?> class="nav-item active" <?php } ?>> <a class="nav-link"
                href="<?php echo url('member/member/pwd');?>">
                <i class=" fa fa-lock"></i>
                <p>修改密码</p>
              </a></li>
            <li <?php if(ROUTE_A=='logout' ) { ?> class="nav-item active" <?php } ?>> <a class="nav-link"
                href="<?php echo url('member/member/logout');?>">

                <i class="fas fa-sign-out-alt"></i>
                <p>退出</p>
              </a></li>
          </ul>
        </li>
      </ul>
    </nav>
  </div>
  <!-- /.sidebar -->
</aside>